<script setup lang="ts">
import { testLogin } from '@/api/login/AuthApi';
import { onMounted, } from 'vue'
import { useRouter } from 'vue-router';
import { useUserStore } from '@/stores/useUserStore'
import  { type LoginResultVo}  from '@/models/openinfo/LoginResultVo';

let userStore = useUserStore();
let router = useRouter();
onMounted(async () => {
    var userinfo: LoginResultVo = await testLogin();
    console.log(userinfo);
    if (userinfo) {
        userStore.setUserInfo(userinfo);
        router.replace("/")
    }
});

</script>